package cn.iocoder.yudao.module.enterprise.dal.mysql.praxisAnnex;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.enterprise.controller.admin.praxisProject.vo.EnterpriseAnnexVO;
import cn.iocoder.yudao.module.enterprise.dal.dataobject.praxisAnnex.EnterpriseAnnexDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 项目附件 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface EnterpriseAnnexMapper extends BaseMapperX<EnterpriseAnnexDO> {

    default List<EnterpriseAnnexDO> selectList(EnterpriseAnnexVO reqVO) {
        return selectList(new LambdaQueryWrapperX<EnterpriseAnnexDO>()
                .likeIfPresent(EnterpriseAnnexDO::getAnnexName, reqVO.getAnnexName())
                .eqIfPresent(EnterpriseAnnexDO::getAnnexUrl, reqVO.getAnnexUrl())
                .eqIfPresent(EnterpriseAnnexDO::getRelationId, reqVO.getRelationId())
                .eqIfPresent(EnterpriseAnnexDO::getRelationType, reqVO.getRelationType())
                .orderByAsc(EnterpriseAnnexDO::getId));
    }
    List<EnterpriseAnnexVO> getPraxisAnnexListByProjectId(@Param("relationId") Long relationId, @Param("relationType") Integer relationType);
}
